package model;

public class Car {
    //车牌号
    private String id;
    private String brand;
    protected double priceDay;
    private boolean isElectric;
    private boolean isRented;

    public Car() {
    }

    public Car(String id, String brand, double priceDay, boolean isElectric, boolean isRented) {
        this.id = id;
        this.brand = brand;
        this.priceDay = priceDay;
        this.isElectric = isElectric;
        this.isRented = false;
    }

    /**
     * 获取
     * @return id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取
     * @return brand
     */
    public String getBrand() {
        return brand;
    }

    /**
     * 设置
     * @param brand
     */
    public void setBrand(String brand) {
        this.brand = brand;
    }

    /**
     * 获取
     * @return priceDay
     */
    public double getPriceDay() {
        return priceDay;
    }

    /**
     * 设置
     * @param priceDay
     */
    public void setPriceDay(double priceDay) {
        this.priceDay = priceDay;
    }

    /**
     * 获取
     * @return isElectric
     */
    public boolean isElectric() {
        return isElectric;
    }

    /**
     * 设置
     * @param isElectric
     */
    public void setIsElectric(boolean isElectric) {
        this.isElectric = isElectric;
    }

    /**
     * 获取
     * @return isRented
     */
    public boolean isRented() {
        return isRented;
    }

    /**
     * 设置
     * @param isRented
     */
    public void setIsRented(boolean isRented) {
        this.isRented = isRented;
    }

    public String getCarInfo() {
        return String.format("车牌号: %s, 品牌: %s, 每日租金: %.2f元, 动力类型: %s, 状态: %s",
                id, brand, priceDay,
                isElectric ? "纯电" : "燃油",
                isRented ? "已出租" : "可租");
    }
    public double TotalPrice(int day) {
        return priceDay * day;
    }
}


